package com.kun.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@NoArgsConstructor
public class TUserFollowing {

    /**
     * 主键ID
     */
    private Long id;
    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 关注用户ID
     */
    @NotNull(message = "关注用户ID不能为空")
    private Long followingId;
    /**
     * 关注分组ID
     */
    private Long groupId;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 是否关注
     */
    @TableField(exist = false)
    private Boolean followed;

    /**
     * 用户信息
     */
    @TableField(exist = false)
    private TUserInfo userInfo;

    public TUserFollowing(Long userId, Long followingId) {
        this.userId = userId;
        this.followingId = followingId;
    }
}
